/************************************************************************
 * The code is owned by mainframer.cn and Shang Tao
 * Without aproval of mainframer.cn and Shang Tao, removing the copyright
 * infomation is regarded as invassion of proprietary copyright
 ***********************************************************************/
package com.mr.qa.bo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;


/**
 * Question
 */

public class Question extends BaseBO
{
    // Fields    

     private User mrIaskUser;
     private QuestionCategory mrIaskCategory;
     private String title;
     private String reference;
     private String content;
     private String addition;
     private String file;
     private String fileName;
     private String state;
     private Date postDate;
    private Date changeDate;
     private String isPoll;
     //private Integer isAnonymous;
     private Boolean isRequireLogin = false;//2008.4.11 added, true means only the user who signs on can view this question
     private Integer viewCount;
    private Set mrIaskAnswers = new HashSet(0);
    private Set mrIaskComments = new HashSet(0);
    private Set mrIaskMyLinks = new HashSet(0);
    private String anonymoususerIP;

    /*
     * whether the question is toped
     * if a question is topped, the changeDate is set the current date
     */
    private Boolean isTop = false;
    
    /*only the category is ad one, this field is meaningful.
     *default to false, true means the admin sets the job ad to expired
     */
    private Boolean isExpired = false;

    /*
     * 2008.10.19, one question can be topped at parent level or only current level
     */
    private Boolean isSecondaryTop = false;

    /*
     * if a question is locked, no answer function
     */
    private Boolean isLocked = false;

    /**
     * if a question is an activity, viewing question screen will display a form for user
     * to enroll by sending email to organizor
     */
    private Boolean isActivity = false;
    
    /**
     * this field is to store the html value for title font attribute, such as color:red, font-weight:bold
     */
    private String titleAttribute;
    
    private Set cities = new HashSet();
    
    private String email;

	public Boolean getIsActivity() {
        return isActivity;
    }

    public void setIsActivity(Boolean isActivity) {
        this.isActivity = isActivity;
    }

    public Boolean getIsLocked() {
        return isLocked;
    }

    public void setIsLocked(Boolean isLocked) {
        this.isLocked = isLocked;
    }

    // Constructors

    /** default constructor */
    public Question() {
    }

	/** minimal constructor */
    public Question(QuestionCategory mrIaskCategory, String title, String content, String state, Date postDate, String isPoll) {
        this.mrIaskCategory = mrIaskCategory;
        this.title = title;
        this.content = content;
        this.state = state;
        this.postDate = postDate;
        this.isPoll = isPoll;
    }
    
    // Property accessors

    
    public User getMrIaskUser() {
        return this.mrIaskUser;
    }
    
    public void setMrIaskUser(User mrIaskUser) {
        this.mrIaskUser = mrIaskUser;
    }

    public QuestionCategory getMrIaskCategory() {
        return this.mrIaskCategory;
    }
    
    public void setMrIaskCategory(QuestionCategory mrIaskCategory) {
        this.mrIaskCategory = mrIaskCategory;
    }

    public String getTitle() {
        return this.title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }

    public String getReference() {
        return this.reference;
    }
    
    public void setReference(String reference) {
        this.reference = reference;
    }

    public String getContent() {
        return this.content;
    }
    
    public void setContent(String content) {
        this.content = content;
    }

    public String getAddition() {
        return this.addition;
    }
    
    public void setAddition(String addition) {
        this.addition = addition;
    }

    public String getFile() {
        return this.file;
    }
    
    public void setFile(String file) {
        this.file = file;
    }

    public String getState() {
        return this.state;
    }
    
    public void setState(String state) {
        this.state = state;
    }

    public Date getPostDate() {
        return this.postDate;
    }
    
    public void setPostDate(Date postDate) {
        this.postDate = postDate;
    }

    public String getIsPoll() {
        return this.isPoll;
    }
    
    public void setIsPoll(String isPoll) {
        this.isPoll = isPoll;
    }

    /*2008.7.28 commented, the field is useless
    public Integer getIsAnonymous() {
        return this.isAnonymous;
    }
    
    public void setIsAnonymous(Integer isAnonymous) {
        this.isAnonymous = isAnonymous;
    }*/

    public Integer getViewCount() {
        return this.viewCount;
    }
    
    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    public Set getMrIaskAnswers() {
        return this.mrIaskAnswers;
    }
    
    public void setMrIaskAnswers(Set mrIaskAnswers) {
        this.mrIaskAnswers = mrIaskAnswers;
    }

    public Set getMrIaskComments() {
        return this.mrIaskComments;
    }
    
    public void setMrIaskComments(Set mrIaskComments) {
        this.mrIaskComments = mrIaskComments;
    }


    public void setFileName(String fileName)
    {
        this.fileName = fileName;
    }
    
    public String getFileName()
    {
        return fileName;
    }

    public void setMrIaskMyLinks(Set mrIaskMyLinks)
    {
        this.mrIaskMyLinks = mrIaskMyLinks;
    }
    
    public Set getMrIaskMyLinks()
    {
        return mrIaskMyLinks;
    }

	public void setChangeDate(Date changeDate) {
		this.changeDate = changeDate;
	}

	public Date getChangeDate() {
		return changeDate;
	}

	public void setIsTop(Boolean isTop) {
		this.isTop = isTop;
	}

	public Boolean getIsTop() {
		return isTop;
	}

	public void setIsRequireLogin(Boolean isRequireLogin) {
		this.isRequireLogin = isRequireLogin;
	}

	public Boolean getIsRequireLogin() {
		return isRequireLogin;
	}

	public void setIsExpired(Boolean isExpired) {
		this.isExpired = isExpired;
	}

	public Boolean getIsExpired() {
		return isExpired;
	}

	public void setIsSecondaryTop(Boolean isSecondaryTop) {
		this.isSecondaryTop = isSecondaryTop;
	}

	public Boolean getIsSecondaryTop() {
		return isSecondaryTop;
	}

	public String getAnonymoususerIP() {
		return anonymoususerIP;
	}

	public void setAnonymoususerIP(String anonymoususerIP) {
		this.anonymoususerIP = anonymoususerIP;
	}

	public String getTitleAttribute() {
		return titleAttribute;
	}

	public void setTitleAttribute(String titleAttribute) {
		this.titleAttribute = titleAttribute;
	}
	
	public Set getCities() {
		return cities;
	}

	public void setCities(Set cities) {
		this.cities = cities;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
}
